<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html><head>
        <link rel="stylesheet" type="text/css" href="apidocs.css"/>
        <title>API docs for &ldquo;sympy.ntheory.residue&rdquo;</title>
        </head>
        <body><h1 class="module">Module s.n.residue</h1><span id="part">Part of <a href="sympy.ntheory.html">sympy.ntheory</a></span><div class="toplevel"><div class="undocumented">Undocumented</div></div><table class="children"><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.residue.totient_">totient_</a></td><td><div><p>returns the number of integers less than n</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.residue.n_order">n_order</a></td><td><div><p>returns the order of a modulo n</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.residue.is_primitive_root">is_primitive_root</a></td><td><div><p>returns True if a is a primitive root of p</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.residue.is_quad_residue">is_quad_residue</a></td><td><div><p>returns True if a is a quadratic residue of p</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.residue.legendre_symbol">legendre_symbol</a></td><td><div><p>return 1 if a is a quadratic residue of p</p>
</div></td></tr></table>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.residue.totient_">totient_(n):</a></div>
            <div class="functionBody"><div><p>returns the number of integers less than n and relatively prime to n</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.residue.n_order">n_order(a, n):</a></div>
            <div class="functionBody"><div><p>returns the order of a modulo n Order of a modulo n is the smallest 
integer k such that a^k leaves a remainder of 1 with n.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.residue.is_primitive_root">is_primitive_root(a, p):</a></div>
            <div class="functionBody"><div><p>returns True if a is a primitive root of p</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.residue.is_quad_residue">is_quad_residue(a, p):</a></div>
            <div class="functionBody"><div><p>returns True if a is a quadratic residue of p p should be a prime and a 
should be relatively prime to p</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.residue.legendre_symbol">legendre_symbol(a, p):</a></div>
            <div class="functionBody"><div><p>return 1 if a is a quadratic residue of p else return -1 p should be an 
odd prime by definition</p>
</div></div>
            </div></body>
        